package com.spring.aop.test;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @ClassName main
 * @Description
 * @Author suncx
 * @Date 2020/5/16 14:03
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext bf = new ClassPathXmlApplicationContext("/aop/AopTest.xml");
        TestBean bean = (TestBean) bf.getBean("test");
        bean.test();
        Lock a = new ReentrantLock();

    }
}
class CAOCAO implements Runnable {
    Lock lock;
    public CAOCAO(Lock lock) {
        this.lock = lock;
    }
    public void run() {
        System.out.println("this is caocao call succ");
    }
}
class SHOUYUE implements Runnable {
    Lock lock;
    public SHOUYUE(Lock lock) {
        this.lock = lock;
    }
    public void run() {
        System.out.println("this is shouyue, call succ");
        lock.lock();
        lock.unlock();
    }
}




